<script lang="ts" setup>
const route = useRoute()
const router = useRouter()

function handleCommand(command: string) {
  router.replace({
    name: command
  })
}
</script>

<template>
  <div>
    <el-dropdown @command="handleCommand">
      <el-button>
        切换登录页风格
        <el-icon class="el-icon--right">
          <IkSvgIcon name="i-ep:arrow-down" />
        </el-icon>
      </el-button>
      <template #dropdown>
        <el-dropdown-menu>
          <el-dropdown-item command="login" :disabled="route.name === 'login'">
            风格1
          </el-dropdown-item>
          <el-dropdown-item command="login2" :disabled="route.name === 'login2'">
            风格2
          </el-dropdown-item>
        </el-dropdown-menu>
      </template>
    </el-dropdown>
  </div>
</template>
